Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always fetch database list on bootstrap payload #11934

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

mistercrunch
Copy link
Member

There was this weird bug happening only when SQLLAB_BACKEND_PERSISTENCE = False where if no database had been selected, there would be some
issue.

This makes sure that the store is populated consistently with the list
of database connections regardless of SQLLAB_BACKEND_PERSISTENCE. It
also uses the DAO to fetch database and will apply the RBAC-related
filters if any, the same way that the API does.

@dpgaspar @hughhhh @betodealmeida

There was this weird bug happening only when `SQLLAB_BACKEND_PERSISTENCE
= False` where if no database had been selected, there would be some
issue.

This makes sure that the store is populated consistently with the list
of database connections regardless of `SQLLAB_BACKEND_PERSISTENCE`. It
also uses the DAO to fetch database and will apply the RBAC-related
filters if any, the same way that the API does.
@@ -76,6 +76,19 @@ def find_by_ids(cls, model_ids: List[int]) -> List[Model]:
).apply(query, None)
return query.all()

@classmethod
def find_all(cls) -> List[Model]:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is very similar to find_by_ids but decided to go explicit over dry. We're already pretty meta here so didn't want to add a layer to safe a few lines of code.

@codecov-io
Copy link

codecov-io commented Dec 4, 2020

Codecov Report

Merging #11934 (756a73b) into master (77d362d) will decrease coverage by 4.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11934      +/-   ##
==========================================
- Coverage   67.64%   63.59%   -4.05%     
==========================================
  Files         932      464     -468     
  Lines       45211    28532   -16679     
  Branches     4333        0    -4333     
==========================================
- Hits        30583    18145   -12438     
+ Misses      14525    10387    -4138     
+ Partials      103        0     -103     
Flag Coverage Δ
cypress ?
javascript ?
python 63.59% <100.00%> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/dao/base.py 96.87% <100.00%> (+0.38%) ⬆️
superset/views/core.py 74.68% <100.00%> (ø)
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/db_engine_specs/hive.py 54.61% <0.00%> (-29.62%) ⬇️
superset/db_engine_specs/presto.py 69.95% <0.00%> (-12.45%) ⬇️
superset/examples/world_bank.py 97.10% <0.00%> (-2.90%) ⬇️
superset/examples/birth_names.py 96.51% <0.00%> (-2.33%) ⬇️
superset/views/database/mixins.py 80.70% <0.00%> (-1.76%) ⬇️
superset/models/core.py 88.04% <0.00%> (-0.82%) ⬇️
superset/connectors/sqla/models.py 90.64% <0.00%> (-0.14%) ⬇️
... and 468 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77d362d...756a73b. Read the comment docs.

Copy link
Member

@hughhhh hughhhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@hughhhh hughhhh marked this pull request as ready for review December 9, 2020 03:28
@hughhhh hughhhh merged commit 150c8e3 into apache:master Dec 9, 2020
@hughhhh hughhhh deleted the fix_database_fetch_sqllab branch December 9, 2020 17:36
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants